package org.ppassantini.cham.core.action.menu;

import java.util.List;
import java.util.Map;

import org.apache.struts2.interceptor.SessionAware;
import org.ppassantini.cham.core.business.security.dto.MenuDto;

import com.opensymphony.xwork2.ActionSupport;

/**
 * @author ppassantini
 * 
 */
public class LinkAction extends ActionSupport implements SessionAware {

	private static final long serialVersionUID = 9028295658269153625L;
	private List<MenuDto> mainMenu;
	private String selectedMenu;
	Map<String, Object> session;

	/**
	 * @return
	 */
	public String getSelectedMenu() {
		return selectedMenu;
	}

	/**
	 * @param selectedMenu
	 */
	public void setSelectedMenu(String selectedMenu) {
		this.selectedMenu = selectedMenu;
	}

	/**
	 * @return
	 */
	public List<MenuDto> getMainMenu() {
		return mainMenu;
	}

	/**
	 * @param mainMenu
	 */
	public void setMainMenu(List<MenuDto> mainMenu) {
		this.mainMenu = mainMenu;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * org.apache.struts2.interceptor.SessionAware#setSession(java.util.Map)
	 */
	@Override
	public void setSession(Map<String, Object> session) {
		this.session = session;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.opensymphony.xwork2.ActionSupport#execute()
	 */
	public String execute() {
		if (selectedMenu == null)
			return "welcome";

		return selectedMenu;
	}

}
